<body onload="test()">
<p>Should alert "PASS".</p>
<script src="/js-test-resources/js-test.js"></script>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function test()
{
    var ws = new WebSocket("ws://127.0.0.1:8880/echo");
    ws.onopen = function() {
        this.send("PASS");
    }
    ws.onmessage = function(msg) {
        alert(msg.data);
        if (window.testRunner)
            testRunner.notifyDone();
    }
    ws = null;
    gc();
}
</script>
